Skip to content

Return iterable of RegExpExecArray from RegExp#[Symbol.matchAll]#60516

Merged
jakebailey merged 2 commits intomicrosoft:mainfrom
lionel-rowe:regexp-symbol-matchall
Feb 6, 2026
Merged

Return iterable of RegExpExecArray from RegExp#[Symbol.matchAll]#60516
jakebailey merged 2 commits intomicrosoft:mainfrom
lionel-rowe:regexp-symbol-matchall

Conversation

@lionel-rowe
Copy link
Contributor

Fixes #60515

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 16, 2024
@lionel-rowe lionel-rowe force-pushed the regexp-symbol-matchall branch from 2fe6cd8 to 313b9d4 Compare November 16, 2024 10:18
@lionel-rowe lionel-rowe force-pushed the regexp-symbol-matchall branch from 313b9d4 to 11944f3 Compare November 16, 2024 10:38
@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 1, 2025

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,370 62,370 ~ ~ ~ p=1.000 n=6
Types 50,386 50,386 ~ ~ ~ p=1.000 n=6
Memory used 196,603k (± 0.02%) 195,391k (± 0.94%) ~ 192,984k 196,684k p=0.298 n=6
Parse Time 1.61s (± 1.02%) 1.61s (± 1.29%) ~ 1.58s 1.63s p=0.935 n=6
Bind Time 0.87s (± 1.39%) 0.88s (± 0.85%) ~ 0.87s 0.89s p=0.240 n=6
Check Time 11.83s (± 0.53%) 11.79s (± 0.71%) ~ 11.71s 11.90s p=0.298 n=6
Emit Time 3.30s (± 1.20%) 3.27s (± 1.17%) ~ 3.22s 3.33s p=0.107 n=6
Total Time 17.61s (± 0.56%) 17.54s (± 0.43%) ~ 17.46s 17.63s p=0.423 n=6
angular-1 - node (v18.15.0, x64)
Errors 56 56 ~ ~ ~ p=1.000 n=6
Symbols 948,753 948,753 ~ ~ ~ p=1.000 n=6
Types 410,846 410,846 ~ ~ ~ p=1.000 n=6
Memory used 1,225,260k (± 0.00%) 1,225,262k (± 0.01%) ~ 1,225,164k 1,225,355k p=1.000 n=6
Parse Time 7.89s (± 0.97%) 7.93s (± 1.10%) ~ 7.79s 8.01s p=0.471 n=6
Bind Time 2.29s (± 0.53%) 2.29s (± 0.51%) ~ 2.28s 2.31s p=0.502 n=6
Check Time 37.92s (± 0.52%) 38.13s (± 0.21%) +0.21s (+ 0.55%) 38.00s 38.22s p=0.045 n=6
Emit Time 17.89s (± 0.54%) 17.89s (± 0.58%) ~ 17.70s 17.98s p=0.810 n=6
Total Time 65.99s (± 0.51%) 66.23s (± 0.22%) ~ 66.04s 66.46s p=0.378 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,509,183 2,509,183 ~ ~ ~ p=1.000 n=6
Types 892,716 892,716 ~ ~ ~ p=1.000 n=6
Memory used 2,804,468k (± 0.00%) 2,804,432k (± 0.00%) ~ 2,804,307k 2,804,619k p=0.689 n=6
Parse Time 10.51s (± 0.20%) 10.51s (± 0.29%) ~ 10.48s 10.56s p=0.935 n=6
Bind Time 2.73s (± 0.38%) 2.73s (± 0.75%) ~ 2.70s 2.75s p=0.868 n=6
Check Time 101.91s (± 1.19%) 101.71s (± 1.44%) ~ 100.51s 104.55s p=0.689 n=6
Emit Time 0.36s (± 1.50%) 0.37s (± 2.41%) ~ 0.36s 0.38s p=0.341 n=6
Total Time 115.51s (± 1.03%) 115.32s (± 1.27%) ~ 114.18s 118.16s p=0.689 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,081 1,227,081 ~ ~ ~ p=1.000 n=6
Types 267,474 267,474 ~ ~ ~ p=1.000 n=6
Memory used 2,853,321k (±13.24%) 2,975,057k (±10.03%) ~ 2,365,324k 3,098,031k p=1.000 n=6
Parse Time 6.59s (± 1.70%) 6.64s (± 1.27%) ~ 6.49s 6.74s p=0.378 n=6
Bind Time 2.16s (± 1.65%) 2.17s (± 1.77%) ~ 2.13s 2.24s p=1.000 n=6
Check Time 42.85s (± 0.63%) 42.84s (± 0.33%) ~ 42.62s 42.97s p=0.810 n=6
Emit Time 3.44s (± 4.87%) 3.50s (± 2.27%) ~ 3.38s 3.62s p=0.296 n=6
Total Time 55.05s (± 0.66%) 55.15s (± 0.35%) ~ 54.90s 55.37s p=0.378 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,081 1,227,081 ~ ~ ~ p=1.000 n=6
Types 267,474 267,474 ~ ~ ~ p=1.000 n=6
Memory used 2,918,825k (±12.88%) 3,161,602k (± 0.02%) ~ 3,160,892k 3,162,420k p=0.575 n=6
Parse Time 8.43s (± 1.39%) 8.54s (± 0.32%) ~ 8.49s 8.57s p=0.065 n=6
Bind Time 2.69s (± 1.80%) 2.65s (± 0.75%) ~ 2.63s 2.68s p=0.258 n=6
Check Time 53.03s (± 0.41%) 53.31s (± 0.54%) ~ 52.88s 53.67s p=0.128 n=6
Emit Time 4.43s (± 2.55%) 4.31s (± 2.71%) ~ 4.20s 4.51s p=0.128 n=6
Total Time 68.61s (± 0.41%) 68.82s (± 0.50%) ~ 68.25s 69.16s p=0.260 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,548 262,548 ~ ~ ~ p=1.000 n=6
Types 107,156 107,156 ~ ~ ~ p=1.000 n=6
Memory used 441,890k (± 0.01%) 441,862k (± 0.01%) ~ 441,775k 441,976k p=0.298 n=6
Parse Time 3.55s (± 0.66%) 3.56s (± 0.97%) ~ 3.52s 3.61s p=0.872 n=6
Bind Time 1.32s (± 0.88%) 1.33s (± 0.79%) ~ 1.31s 1.34s p=0.800 n=6
Check Time 18.90s (± 0.33%) 18.88s (± 0.35%) ~ 18.82s 18.97s p=0.630 n=6
Emit Time 1.54s (± 0.86%) 1.53s (± 0.90%) ~ 1.51s 1.54s p=0.156 n=6
Total Time 25.31s (± 0.20%) 25.30s (± 0.44%) ~ 25.19s 25.44s p=0.521 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 71 71 ~ ~ ~ p=1.000 n=6
Symbols 225,367 225,367 ~ ~ ~ p=1.000 n=6
Types 94,290 94,290 ~ ~ ~ p=1.000 n=6
Memory used 371,104k (± 0.00%) 371,199k (± 0.04%) +95k (+ 0.03%) 371,117k 371,531k p=0.008 n=6
Parse Time 2.90s (± 0.44%) 2.88s (± 0.87%) ~ 2.85s 2.92s p=0.224 n=6
Bind Time 1.61s (± 1.07%) 1.60s (± 1.66%) ~ 1.57s 1.64s p=0.466 n=6
Check Time 16.36s (± 0.14%) 16.37s (± 0.32%) ~ 16.29s 16.43s p=0.421 n=6
Emit Time 0.00s 0.00s (±244.70%) ~ 0.00s 0.01s p=0.405 n=6
Total Time 20.87s (± 0.18%) 20.86s (± 0.28%) ~ 20.75s 20.92s p=0.809 n=6
vscode - node (v18.15.0, x64)
Errors 33 33 ~ ~ ~ p=1.000 n=6
Symbols 3,499,334 3,499,334 ~ ~ ~ p=1.000 n=6
Types 1,177,235 1,177,234 -1 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 3,549,909k (± 0.00%) 3,549,720k (± 0.01%) ~ 3,549,461k 3,549,972k p=0.093 n=6
Parse Time 15.05s (± 0.75%) 15.03s (± 0.55%) ~ 14.92s 15.13s p=0.520 n=6
Bind Time 4.90s (± 0.56%) 4.90s (± 0.42%) ~ 4.86s 4.92s p=0.685 n=6
Check Time 98.60s (± 4.95%) 96.16s (± 3.36%) ~ 93.76s 101.66s p=0.230 n=6
Emit Time 30.57s (± 2.94%) 30.89s (± 4.28%) ~ 29.38s 32.88s p=0.689 n=6
Total Time 149.13s (± 3.76%) 146.98s (± 2.64%) ~ 143.01s 152.75s p=0.471 n=6
webpack - node (v18.15.0, x64)
Errors 2 2 ~ ~ ~ p=1.000 n=6
Symbols 318,019 318,019 ~ ~ ~ p=1.000 n=6
Types 137,705 137,704 -1 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 472,238k (± 0.03%) 472,120k (± 0.02%) ~ 471,967k 472,281k p=0.298 n=6
Parse Time 4.34s (± 0.32%) 4.35s (± 0.57%) ~ 4.33s 4.40s p=0.677 n=6
Bind Time 1.78s (± 1.61%) 1.77s (± 0.75%) ~ 1.75s 1.78s p=0.682 n=6
Check Time 20.75s (± 0.48%) 20.66s (± 0.39%) ~ 20.54s 20.74s p=0.199 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 26.87s (± 0.39%) 26.78s (± 0.25%) ~ 26.67s 26.84s p=0.148 n=6
xstate-main - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 665,978 665,978 ~ ~ ~ p=1.000 n=6
Types 199,345 199,345 ~ ~ ~ p=1.000 n=6
Memory used 570,437k (± 0.01%) 570,349k (± 0.01%) -88k (- 0.02%) 570,247k 570,411k p=0.031 n=6
Parse Time 4.25s (± 0.53%) 4.26s (± 0.49%) ~ 4.24s 4.29s p=0.328 n=6
Bind Time 1.33s (± 1.04%) 1.32s (± 1.03%) ~ 1.30s 1.34s p=0.935 n=6
Check Time 19.92s (± 0.34%) 19.90s (± 0.26%) ~ 19.86s 19.97s p=0.332 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.50s (± 0.24%) 25.49s (± 0.24%) ~ 25.43s 25.59s p=0.629 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/60516/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60516/merge:

Everything looks good!

@typescript-bot typescript-bot removed the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Feb 6, 2026
Copilot AI review requested due to automatic review settings February 6, 2026 22:05
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Feb 6, 2026
@jakebailey jakebailey enabled auto-merge February 6, 2026 22:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns TypeScript’s lib typing for RegExp#[Symbol.matchAll] with the already-correct String#matchAll behavior by returning an iterator of RegExpExecArray (fixing #60515).

Changes:

  • Updated RegExp#[Symbol.matchAll] to return RegExpStringIterator<RegExpExecArray> instead of RegExpMatchArray.
  • Updated compiler test baselines to reflect the new iterator element type (including index/input becoming non-optional).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
tests/baselines/reference/regexMatchAll.types Baseline updated to show RegExpExecArray element type and required index/input.
tests/baselines/reference/regexMatchAll-esnext.types Same baseline update for the esnext target test.
src/lib/es2020.symbol.wellknown.d.ts Changes RegExp#[Symbol.matchAll] return type to RegExpStringIterator<RegExpExecArray>.

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Feb 6, 2026
@jakebailey jakebailey added this pull request to the merge queue Feb 6, 2026
Merged via the queue into microsoft:main with commit 8bb72d2 Feb 6, 2026
28 of 29 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

RegExp#[Symbol.matchAll] should return iterable of RegExpExecArray instead of RegExpMatchArray

4 participants